<%--
  Created by IntelliJ IDEA.
  User: apple
  Date: 2022/4/26
  Time: 3:41 下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath()+"/";%>
<!doctype html>
<html>
<head>
    <base href="<%=path%>">
    <title>用户管理</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="js/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet">
</head>
<body class="gray-bg" style="background-color: #f3f3f4;overflow-x: hidden;">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-md-12" style="border:0px solid red">
            <div>
                <form class="form-horizontal" id="objectForm">
                        <label for="exampleInputName2">部门名称</label>
                        <input type="text"  class="form-control" style="display: inline-block;width:200px;" id="exampleInputName2" name="deptName" placeholder="部门名称">
                    <button type="button" class="btn btn-success" onclick="$.table.refresh();"><i class="glyphicon glyphicon-search"></i> 搜索</button>
                </form>
            </div>
            <div id="treeDemo" class="ztree" style="width: 200px;margin: auto;"></div>
        </div>

    </div>
</div>

<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.7"></script>
<script src="js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="js/plugins/layer/layer.min.js"></script>
<script src="js/sofwin.js"></script>
<script src="js/plugins/ztree/js/jquery.ztree.core.js"></script>
</body>
<style>
</style>
<script>
    var deptName;
    var deptId;
    var zTreeObj;
    // zTree 的参数配置，深入使用请参考 API 文档（setting 配置详解）
    var setting = {
        data:{
            simpleData:{
                enable: true,
                idKey: 'deptId',
                pIdKey: 'parentId'
            }
        },
        callback:{
            onClick:function(event,treeId,treeNode,clickFlagNumber){
                deptName = treeNode.name;
                deptId = treeNode.deptId;

            }
        }
    };
    function setParentValue(){
        parent.setParent(deptName,deptId);
        parent.close();
    }

    // zTree 的数据属性，深入使用请参考 API 文档（zTreeNode 节点数据详解）
    var zNodes = [];

    $(document).ready(function(){
        $.operator.post('dept/data','',function(ret){
            zNodes = ret.data;
            zTreeObj = $.fn.zTree.init($("#treeDemo"), setting, zNodes);
            zTreeObj.expandAll(true);
        })

    });


</script>

</html>